import { INCREMENT, DECREMENT } from '../types'
export default function countReducer(previous = 0, action) {
  const { type, data } = action
  switch (type) {
    case INCREMENT:
      return previous + data
    case DECREMENT:
      return previous - data
    default:
      return previous
  }
}
